package month4.day21;

import java.util.HashMap;
import java.util.Hashtable;

public class G1 {
    public static void main(String[] args) {
        Hashtable hashtable = new Hashtable<>();
        long kai = System.nanoTime();
        for (int i = 0; i < 100000; i++) {
            hashtable.put(i, Math.random()*100000);
        }
        long jie = System.nanoTime();
        System.out.println(-(kai - jie));

        HashMap hashMap = new HashMap<>();
        long qi = System.nanoTime();
        for (int i = 0; i < 100000; i++) {
            hashMap.put(i, Math.random()*100000);
        }
        long wei = System.nanoTime();
        System.out.println(-(qi-wei));
        System.out.println("-----------------------------------");
        long k = System.nanoTime();
        for(int i=0;i<100;i++){
            hashtable.remove(Math.random()*100000);
        }
        long j = System.nanoTime();
        System.out.println(j-k);

        long q = System.nanoTime();
        for(int i=0;i<100;i++){
            hashMap.remove(Math.random()*100000);
        }
        long w = System.nanoTime();
        System.out.println(w-q);
    }
}
